/*
 * @lc app=leetcode.cn id=1662 lang=golang
 *
 * [1662] 检查两个字符串数组是否相等
 */
package Solutions

// @lc code=start
func arrayStringsAreEqual(word1 []string, word2 []string) bool {
	i, j := 0, 0
	p1, p2 := 0, 0
	for i < len(word1) && j < len(word2) {
		if word1[i][p1] != word2[j][p2] {
			return false
		}
		p1++
		p2++
		if p1 == len(word1[i]) {
			i++
			p1 = 0
		}
		if p2 == len(word2[j]) {
			j++
			p2 = 0
		}
	}
	if i == len(word1) && j == len(word2) {
		return true
	}
	return false

}

// @lc code=end
